import packageInfo from '../package.json';
// const serverPort = 3001;
const serverPort = 3000;
// const apiHost = process.env.API_HOST || 'internal-dir-prd-portal-data-api-int-alb-1968489018.cn-northwest-1.elb.amazonaws.com.cn';
const apiHost = process.env.API_HOST || 'http://internal-dir-stg-portal-data-api-int-alb-628884616.cn-northwest-1.elb.amazonaws.com.cn';
//  const apiPort = 80;    
const apiPort = 8080;
// const apiPort = 8086;

const local = process.env.APP_ENV === 'localhost';

/**
 * Parse attributes from package.json
 * Please ensure following in your tsconfig.json
 *  "resolveJsonModule": true
 *  "esModuleInterop": true,
 */
export const DEFAULT_APP_NAME = packageInfo.name;
export const DEFAULT_APP_VERSION = packageInfo.version;

export const configs = {
  // basic app info.
  appName: process.env.APP_NAME || DEFAULT_APP_NAME,
  appVersion: process.env.APP_VERSION || DEFAULT_APP_VERSION,
  // default host/port of frontend server
  serverPort: serverPort,
  frontServer: `http://localhost:${serverPort}`,
  // default host/port of backend server
  apiHost: apiHost,
  apiPort: apiPort,
  // apiServer: local
  //   ? 'https://dir-stg-portal-data-api-ext-402589624.ap-northeast-1.elb.amazonaws.com'
  //   : `http://${apiHost}:${apiPort}`,
  // apiServer: `http://internal-dir-prd-portal-data-api-int-alb-1968489018.cn-northwest-1.elb.amazonaws.com.cn:${apiPort}`,
  apiServer: `http://109.105.26.50:${apiPort}`,//恒超本地8080
  // apiServer: `http://109.105.34.72:${apiPort}`, //端口8096
  // apiServer: `http://internal-dir-stg-portal-data-api-int-alb-628884616.cn-northwest-1.elb.amazonaws.com.cn:${apiPort}`,//测试环境80
  apiPrefix: '/api/data',
  // BDP API info.
  bdpApiBaseUrl:
    process.env.APP_ENV === 'production'
      ? 'https://bigdata.samsung.com/bdp-openapi-batch'
      : 'https://bp-gcp-dev.di.atlas.samsung.com/bdp-openapi-batch', // localhost, stage
  bdpApiToken: process.env.BDP_API_TOKEN || '',
};

console.log('~~~~ local:', local, '  configs:', configs)



export const consts = {
  testUAs: {
    chromeWindows:
      'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
    chromeLinux:
      'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36',
    firefoxLinux:
      'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0',
    whaleWindows:
      'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.229 Whale/2.10.123.42 Safari/537.36',
    microSoftIE:
      'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 10.0; WOW64;\
       Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729;\
        .NET CLR 3.5.30729; WebConferencePro; secssobrowser; WCShortCut; Zoom 3.6.0; wbx 1.0.0; cwms 1.0.0; KnoxMeeting; KMShortCut',
    microSoftEdge:
      'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36 Edge/16.16299',
  },
  uaWarnHtmlText: "<h1>Ooops ! I don't deal with IE|Edge faimly!</h1>",
};
